<?php

session_start();
require_once('connect.php');
require_once('includes/user.class.php');

$database = Database::getInstance();
$user = new User();

if(!$user->is_leader()) header('Location: index.php');
require_once('partials/header.php'); //wczytaj header i menu
?>


    <div class="container">

        <div class="row">

            <div class="col-md-3">

                <?php require_once('partials/content-left-menu.php'); ?>

            </div>

            <div class="col-md-9">
				<div class="subject-table">
					<div class="subject-table-header subject-table-row">
						<div class="subject-table-header-cell">Imię</div>
						<div class="subject-table-header-cell">Nazwisko</div>
                        <div class="subject-table-header-cell">Numer albumu</div>
						<div class="subject-table-header-cell">E-mail</div>
					</div>
					
					<?php
					$studentsData = $user -> get_students();

					foreach($studentsData as $student){
						print '<div class="subject-table-row">';
						print'<div class="subject-table-header-cell">'.$student['firstName'].'</div>';
						print'<div class="subject-table-header-cell">'.$student['lastName'].'</div>';
						print'<div class="subject-table-header-cell">'.$student['album'].'</div>';
                        print'<div class="subject-table-header-cell">'.$student['mail'].'</div>';
						print '</div>';
					}
					?>
				</div>

            </div>

        </div>

    </div>

 
<?php
require_once('partials/footer.php');
?>
